﻿using System.Drawing;

namespace ClockwiseClient
{
    public enum EnumGraph
    {
        GRAPH_DAPAN = 0,
        GRAPH_DUOGU,
        GRAPH_FENXI,
        GRAPH_INFOR,
        GRAPH_PRICE,
        GRAPH_RADAR,
        GRAPH_TRADE,

        GRAPH_COUNT,
        GRAPH_INVALID = -1
    }

    public abstract class ClassGraph
    {
        protected Font font = new Font("宋体", 12);
        protected Font fontBold = new Font("黑体", 11);
        protected Font fontTitle0 = new Font("楷体", 14);
        protected Font fontTitle1 = new Font("楷体", 18);
        protected Font fontTitle2 = new Font("楷体", 22);
        protected SizeF stringSize;
        protected StringFormat format = new StringFormat();
        protected Rectangle rect;
        protected ClassStockItem me;

        public abstract void Paint(Graphics g, Rectangle rect);
        public virtual EnumGraph GetGraphType() { return EnumGraph.GRAPH_INVALID; }
        public virtual int GetGraphMode() { return 0; }
        public virtual void SetGraphMode(int mode) { }
        public virtual void MouseWheel(int delta) { }
        public virtual bool MouseClick(int x, int y, Graphics g) { return false; }
        public virtual bool MouseDouble(int x, int y, Graphics g) { return false; }
        public virtual void KeyDown(Graphics g) { }
        public virtual void KeyUp(Graphics g) { }
        public virtual bool KeyEnter() { return false; }
        public virtual bool KeyEsc() { return false; }
        public virtual void KeyAltZ() 
        {
            ClassStockData classStockData = (ClassStockData)ClassStock.GetInstance();
            classStockData.AddToZixuangu(me.symbol);
        }
        public virtual bool KeyHome() { return false;  }
        public virtual bool KeyEnd() { return false; }
    }
}
